package com.hc.common;

import java.net.InetAddress;

public class Address {
	private InetAddress address;
	private int port;
	public Address(InetAddress address, int port) {
		super();
		this.address = address;
		this.port = port;
	}
	public InetAddress getAddress() {
		return address;
	}
	public void setAddress(InetAddress address) {
		this.address = address;
	}
	public int getPort() {
		return port;
	}
	public void setPort(int port) {
		this.port = port;
	}
	@Override
	public boolean equals(Object obj) {
		if(obj instanceof Address){
			Address inputObj = (Address)obj;
			if(address.getHostAddress().equals(inputObj.getAddress().getHostAddress())&&port == inputObj.getPort()){
				return true;
			}else{
				return false;
			}
		}
		return super.equals(obj);
	}
}
